#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <queue>
#include <vector>
#include <iostream>
#define MAX_SIZE 1001
using namespace std;

// reference: https://www.cnblogs.com/wanghao-boke/p/10043281.html
int N, Num[MAX_SIZE];

// 以hash来做标，数值来进行对比
struct cmp
{
    bool operator()(int i, int j)
    {
        return Num[i] > Num[j];
    }
};
int main()
{
    int origin_hash, temp = 1;
    bool first = true;
    int indegree[MAX_SIZE] = {0};
    scanf("%d", &N);
    vector<vector<int>> graph(N);
    priority_queue<int, vector<int>, cmp> q;
    for (int i = 0; i < N;i++)
    {
        scanf("%d", &Num[i]);

        // 负数不算入
        if (Num[i] < 0)
            continue;

        origin_hash = Num[i] % N;
        if (origin_hash == i)
            q.push(i);
        else
        {
            do
            {
                // 以上一个点hash引做标 输入现在的值
                graph[origin_hash].push_back(i);

                // 线性探测到下一个
                origin_hash = (Num[i] + temp) % N;
                temp++;
                indegree[i]++;
            } while (origin_hash != i);
        }
        temp = 1;
    }
    while(!q.empty())
    {
        temp = q.top();
        q.pop();
        if(first)
        {
            printf("%d", Num[temp]);
            first = false;
        }
        else
            printf(" %d", Num[temp]);

        for (int i = 0; i < graph[temp].size(); i++)
            if (--indegree[graph[temp][i]] == 0)
                q.push(graph[temp][i]);
    }
    return 0;
}